/**
 * Created by lxy_920912 on 2017/1/19.
 */
var climbStairs = function(n) {
    var result = [];
    result[0] = 0;
    result[1] = 1;
    result[2] = 2;
    for( var i = 3;i <= n;i++){
        result[i] = result[i-2]+result[i-1];
    }

    return result[n];
};